package es.cea.negocio;

import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;


public class Persistencia {

//	   private static final Log log = LogFactory.getLog(Persistencia.class);

	    private final SessionFactory sessionFactory = getSessionFactory();
	    
	    public static SessionFactory getSessionFactory() {
	        try {
//	            return (SessionFactory) new InitialContext().lookup("SessionFactory");
				return new Configuration().configure("hibernate.cfg.xml").buildSessionFactory();
	  
	        	
	        }
	        catch (Exception e) {
	        	e.printStackTrace();
	        	return null;
	        }
	    }
	    
}
